home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
vc
/
pro15
/
examples.prg
< prev
next >
Wrap
Text File
|
1993-04-15
|
27KB
|
683 lines
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ │
* ▌│ Function: makewpc() │
* ▌│ Purpose : WordPerfect codes added or removed │
* ▌│ Usage : │
* ▌│ │
* ▌│ Program : docMakkr(tm) examples │
* ▌│ Author : Copyright (C) 1992, LumiNet Publishing Corporation │
* ▌│ All Rights Reserved. │
* ▌│ │
* ▌│ Comments: Required linked libraries include: │
* ▌│ SUPER5.LIB │
* ▌│ CLP2WPC.LIB │
* ▌│ FUNCKY50.LIB │
* ▌│ │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
*-------------------------------------------------------------------------*
* Function to text salutation for determining if hard returns are
* required (sort of limited scope here - idea is to get something
* up and running)
*-------------------------------------------------------------------------*
Function Make_WPC_line
parameters textline, sr
** variable sr will be 'S'-Strip out code or 'R'-Replace with WPC code
private extra_large, very_large, large, small, fine, superscript
private subscript, outline, italics, shadow, redline, dbl_under, bold
private strike_out, underline, small_caps
private maxcode
private wpccount, newline
private leftmark, rightmark, badline, thecode, firsthalf, lasthalf
maxcode=53
private wpccode[maxcode]
*-------------------------------------------------------------------------*
* WPC Attribute values
*-------------------------------------------------------------------------*
Extra_large= 0
Very_large = 1
Large = 2
Small = 3
Fine = 4
Superscript= 5
Subscript = 6
Outline = 7
Italics = 8
Shadow = 9
Redline = 10
Dbl_under = 11
Bold = 12
Strike_out = 13
Underline = 14
Small_caps = 15
*-------------------------------------------------------------------------*
* WPC Blitzen(tm) codes
*-------------------------------------------------------------------------*
wpccode[1] ="LRMARG|"
wpccode[2] ="TBMARG|"
wpccode[3] ="PAGENO|"
wpccode[4] ="JUST|"
wpccode[5] ="HOR|"
wpccode[6] ="VER|"
wpccode[7] ="BOLD|ON"
wpccode[8] ="BOLD|OFF"
wpccode[9] ="CENTER"
wpccode[10] ="DBLUND|ON"
wpccode[11] ="DBLUND|OFF"
wpccode[12] ="EXLRG|ON"
wpccode[13] ="EXLRG|OFF"
wpccode[14] ="FINE|ON"
wpccode[15] ="FINE|OFF"
wpccode[16] ="HARDPAGE|"
wpccode[17] ="HR|"
wpccode[18] ="INDENT|"
wpccode[19] ="ITALIC|ON"
wpccode[20] ="ITALIC|OFF"
wpccode[21] ="LARGE|ON"
wpccode[22] ="LARGE|OFF"
wpccode[23] ="OUTLN|ON"
wpccode[24] ="OUTLN|OFF"
wpccode[25] ="REDLN|ON"
wpccode[26] ="REDLN|OFF"
wpccode[27] ="SHAD|ON"
wpccode[28] ="SHAD|OFF"
wpccode[29] ="SMALL|ON"
wpccode[30] ="SMALL|OFF"
wpccode[31] ="SMCAP|ON"
wpccode[32] ="SMCAP|OFF"
wpccode[33] ="SOFT|ON"
wpccode[34] ="SOFT|OFF"
wpccode[35] ="SUBSC|ON"
wpccode[36] ="SUBSC|OFF"
wpccode[37] ="SUPSC|ON"
wpccode[38] ="SUPSC|OFF"
wpccode[39] ="TAB|"
wpccode[40] ="UNDLN|ON"
wpccode[41] ="UNDLN|OFF"
wpccode[42] ="SDATE|"
wpccode[43] ="VLARGE|ON"
wpccode[44] ="VLARGE|OFF"
wpccode[45] ="STRIKE|ON"
wpccode[46] ="STRIKE|OFF"
wpccode[47] ="NEWCOL|ON"
wpccode[48] ="NEWCOL|OFF"
wpccode[49] ="H/FSTART|"
wpccode[50] ="H/FEND|"
wpccode[51] ="SETTAB|"
wpccode[52] ="FIGGR|"
wpccode[53] ="FNTCHG|"
*-------------------------------------------------------------------------*
* Find all of the WPC codes in the string of text, and convert into
* the appropriate docMakkr(tm) calls
* Depending on the value of the memory variable 'sr':
* = 'R'....indicates that a WordPerfect document is to be created -
* thereby replacing all WordPerfect formatting codes with
* their equivalent from the docMakkr toolkit library.
*
* = 'S'....indicates that a text or print file is to be created -
* thereby stripping out all WordPerfect formatting codes
* Searches for the occurrence of CHR(204) and CHR(185) pair. This pair
* will indicate that a WordPerfect code has been found within the text
* string.
*-------------------------------------------------------------------------*
leftmark = AT(CHR(204), textline)
badline=.F.
wpccount=0
thecode=""
firsthalf=""
lasthalf=""
newline=""
If !Empty(textline)
textline = STRTRAN(textline,CHR(141))+" "
textline = STRTRAN(textline,CHR(9))+""
Endif
If leftmark = 0
If sr = "R"
WpAdd(textline)
Endif
Else
DO WHILE leftmark != 0 .AND. !badline
rightmark = AT(CHR(185), textline)
IF rightmark = 0
badline = .T.
If sr = "R"
WpAdd(textline)
Endif
Exit
ELSE
*- extract the item between the delimiters
thecode = SUBSTR(textline, leftmark + 1,rightmark - leftmark - 1)
IF !EMPTY(thecode)
firsthalf = SUBSTR(textline, 1, leftmark - 1)
lasthalf = SUBSTR(textline, rightmark + 1)
newline = firsthalf+lasthalf
If sr = "R"
WpAdd(firsthalf)
*-- make sure it's a valid WPC Blitzen(tm) code --*
for wpccount = 1 to maxcode
If wpccode[wpccount] $ thecode
Parse_Code(thecode)
Endif
next
textline=lasthalf
Else
textline=newline
Endif
ENDIF
leftmark = AT(CHR(204), textline)
If leftmark = 0
If sr = "R"
WpAdd(textline)
Endif
Exit
Endif
ENDIF
ENDDO
Endif
If sr = "S"
?textline
Else
If !softon
WpHRTN(1)
Endif
Endif
Return(.T.)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ │
* ▌│ Function: parse_code() │
* ▌│ Purpose : WordPerfect codes added │
* ▌│ Usage : │
* ▌│ │
* ▌│ Author : Copyright (C) 1992, LumiNet Publishing Corporation │
* ▌│ All Rights Reserved. │
* ▌│ │
* ▌│ Comments: Required linked libraries include: │
* ▌│ SUPER5.LIB │
* ▌│ CLP2WPC.LIB │
* ▌│ FUNCKY50.LIB │
* ▌│ │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
*-------------------------------------------------------------------------*
* Translate the WPC code
* Objective........Convert the WordPerfect text & document formatting
* codes that appear in a memo field into their actual
* WordPerfect equivalent.
* Arguments........The entire code value is passed, which includes user
* defined paramaters, such as # of inches within a
* left and right margin.
* Returns..........nothing
* Translation......Uses the docMakkr(tm) toolkit library of routines to
* transform user formatting requests into a
* WordPerfect compatable document.
*-------------------------------------------------------------------------*
Function Parse_code
Parameters codefound
private mark, wpcval, wpcval2, wpcval3, wpcval4, comma
DO CASE
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Left / Right Margins │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "LRMARG|" $ codefound
mark = AT("|", codefound)
If mark > 0
comma = AT(",", codefound)
If comma > 0
wpcval = VAL(Substr(codefound, mark + 1, comma - mark - 1)) * 1200
wpcval2 = VAL(Substr(codefound, comma + 1)) * 1200
If wpcval > 0 .and. wpcval2 > 0
WpLRMarg(wpcval, wpcval2)
Endif
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Top / Bottom Margins │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "TBMARG|" $ codefound
mark = AT("|", codefound)
If mark > 0
comma = AT(",", codefound)
If comma > 0
wpcval = VAL(Substr(codefound, mark + 1, comma - mark - 1)) * 1200
wpcval2 = VAL(Substr(codefound, comma + 1)) * 1200
If wpcval > 0 .and. wpcval2 > 0
WpTBMarg(wpcval, wpcval2)
Endif
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Page Numbering Position │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "PAGENO|" $ codefound
mark = AT("|", codefound)
If mark > 0
mark=mark+1
wpcval = VAL(Alltrim(SUBSTR(codefound, mark)))
If wpcval > 0
WpHPAGE(wpcval)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Justification │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "JUST|" $ codefound
mark = AT("|", codefound)
If mark > 0
mark=mark+1
wpcval = VAL(Alltrim(SUBSTR(codefound, mark)))
If wpcval > 0
WpJUST(wpcval)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Horizontal Line │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "HOR|" $ codefound
mark = AT("|", codefound)
If mark > 0
commafir = 0
commasec = ATNEXT(",", codefound,1)
If commasec > 0
wpcval1 = VAL(Substr(codefound, mark + 1, commasec - mark - 1))
wpcval2 = VAL(Substr(codefound, commasec+1,1))
wpcval3 = VAL(Substr(codefound, AtNext(",", codefound,2)+1,1))
wpcval4 = VAL(Substr(codefound, AtNext(",", codefound,3)+1, AtNext(",",codefound,4)-AtNext(",",codefound,3)-1))
wpcval5 = VAL(Substr(codefound, AtNext(",", codefound,4)+1, AtNext(",",codefound,5)-AtNext(",",codefound,4)-1))
wpcval6 = VAL(Substr(codefound, AtNext(",", codefound,5)+1))
WpHLine(wpcval1, wpcval2, wpcval3, wpcval4, wpcval5, wpcval6)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Vertical Line │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "VER|" $ codefound
mark = AT("|", codefound)
If mark > 0
commafir = 0
commasec = ATNEXT(",", codefound,1)
If commasec > 0
wpcval1 = VAL(Substr(codefound, mark + 1, commasec - mark - 1))
wpcval2 = VAL(Substr(codefound, commasec+1,1))
wpcval3 = VAL(Substr(codefound, AtNext(",", codefound,2)+1,1))
wpcval4 = VAL(Substr(codefound, AtNext(",", codefound,3)+1, AtNext(",",codefound,4)-AtNext(",",codefound,3)-1))
wpcval5 = VAL(Substr(codefound, AtNext(",", codefound,4)+1, AtNext(",",codefound,5)-AtNext(",",codefound,4)-1))
wpcval6 = VAL(Substr(codefound, AtNext(",", codefound,5)+1))
WpVLine(wpcval1, wpcval2, wpcval3, wpcval4, wpcval5, wpcval6)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Bold (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "BOLD|ON" $ codefound
WpAttOn(Bold)
CASE "BOLD|OFF" $ codefound
WpAttOff(Bold)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Line Centering │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "CENTER" $ codefound
WpCntr()
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Double Underline (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "DBLUND|ON" $ codefound
WpAttOn(Dbl_under)
CASE "DBLUND|OFF" $ codefound
WpAttOff(Dbl_under)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Strikeout (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "STRIKE|ON" $ codefound
WpAttOn(Strike_out)
CASE "STRIKE|OFF" $ codefound
WpAttOff(Strike_out)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Extra Large (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "EXLRG|ON" $ codefound
WpAttOn(Extra_large)
CASE "EXLRG|OFF" $ codefound
WpattOff(Extra_large)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Very Large (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "VLARGE|ON" $ codefound
WpAttOn(Very_large)
CASE "VLARGE|OFF" $ codefound
WpattOff(Very_large)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Fine (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "FINE|ON" $ codefound
WpattOn(Fine)
CASE "FINE|OFF" $ codefound
WpattOff(Fine)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Hard Page Return │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "HARDPAGE|" $ codefound
mark = AT("|", codefound)
If mark > 0
mark=mark+1
wpcval = VAL(Alltrim(SUBSTR(codefound, mark)))
If wpcval > 0
WpHPAGE(wpcval)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Hard Line Return │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "HR|" $ codefound
mark = AT("|", codefound)
If mark > 0
mark=mark+1
wpcval = VAL(Alltrim(SUBSTR(codefound, mark)))
If wpcval > 0
WpHRTN(wpcval)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Indent │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "INDENT|" $ codefound
mark = AT("|", codefound)
If mark > 0
mark=mark+1
wpcval = VAL(Alltrim(SUBSTR(codefound, mark)))
If wpcval > 0
WpINDENT(wpcval)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Italics (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "ITALIC|ON" $ codefound
WpAttOn(Italics)
CASE "ITALIC|OFF" $ codefound
WpAttOff(Italics)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Large (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "LARGE|ON" $ codefound
WpAttOn(Large)
CASE "LARGE|OFF" $ codefound
WpAttOff(Large)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Outline (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "OUTLN|ON" $ codefound
WpAttOn(Outline)
CASE "OUTLN|OFF" $ codefound
WpAttOff(Outline)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Redline (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "REDLN|ON" $ codefound
WpAttOn(Redline)
CASE "REDLN|OFF" $ codefound
WpAttOff(Redline)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Shadow (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "SHAD|ON" $ codefound
WpAttOn(Shadow)
CASE "SHAD|OFF" $ codefound
WpAttOff(Shadow)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Small (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "SMALL|ON" $ codefound
WpAttOn(Small)
CASE "SMALL|OFF" $ codefound
WpAttOff(Small)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Small Caps (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "SMCAP|ON" $ codefound
WpAttOn(Small_caps)
CASE "SMCAP|OFF" $ codefound
WpAttOff(Small_caps)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Soft Return (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "SOFT|ON" $ codefound
softon=.T.
CASE "SOFT|OFF" $ codefound
softon=.F.
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Subscript (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "SUBSC|ON" $ codefound
WpAttOn(Subscript)
CASE "SUBSC|OFF" $ codefound
WpAttOff(Subscript)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Superscript (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "SUPSC|ON" $ codefound
WpAttOn(Superscript)
CASE "SUPSC|OFF" $ codefound
WpAttOff(Superscript)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Underline (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "UNDLN|ON" $ codefound
WpAttOn(Underline)
CASE "UNDLN|OFF" $ codefound
WpAttOff(Underline)
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Tab │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "TAB|" $ codefound
mark = AT("|", codefound)
If mark > 0
mark=mark+1
wpcval = Max (VAL(Alltrim(SUBSTR(codefound, mark))), 1)
If wpcval > 0
wptab(wpcval)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ System Date and Time │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "SDATE|" $ codefound
mark = AT("|", codefound)
If mark > 0
mark=mark+1
wpcval = Alltrim(SUBSTR(codefound, mark))
If !Empty(wpcval)
WpDATE(wpcval)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Set Tabs (maximum of 6 settings) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "SETTAB|" $ codefound
mark = AT("|", codefound)
If mark > 0
commafir = 0
commasec = ATNEXT(",", codefound,1)
If commasec > 0
wpcval1 = VAL(Substr(codefound, mark + 1, commasec - mark - 1))
wpcval2 = VAL(Substr(codefound, commasec+1,1))
wpcval3 = VAL(Substr(codefound, AtNext(",", codefound,2)+1,1))
wpcval4 = VAL(Substr(codefound, AtNext(",", codefound,3)+1, AtNext(",",codefound,4)-AtNext(",",codefound,3)-1))
wpcval5 = VAL(Substr(codefound, AtNext(",", codefound,4)+1, AtNext(",",codefound,5)-AtNext(",",codefound,4)-1))
wpcval6 = VAL(Substr(codefound, AtNext(",", codefound,5)+1, AtNext(",",codefound,6)-AtNext(",",codefound,5)-1))
wpcval7 = VAL(Substr(codefound, AtNext(",", codefound,6)+1, AtNext(",",codefound,7)-AtNext(",",codefound,6)-1))
wpcval8 = VAL(Substr(codefound, AtNext(",", codefound,7)+1, AtNext(",",codefound,8)-AtNext(",",codefound,7)-1))
wpcval9 = VAL(Substr(codefound, AtNext(",", codefound,8)+1, AtNext(",",codefound,9)-AtNext(",",codefound,8)-1))
wpcval0 = VAL(Substr(codefound, AtNext(",", codefound,9)+1))
WpSetTab(wpcval1, wpcval2, wpcval3, wpcval4, wpcval5, wpcval6, wpcval7, wpcval8, wpcval9, wpcval0)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Figure Graphics │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "FIGGR|" $ codefound
mark = AT("|", codefound)
If mark > 0
commafir = 0
commasec = ATNEXT(",", codefound,1)
If commasec > 0
wpcval1 =Substr(codefound, mark + 1, commasec - mark - 1)
wpcval2 = Substr(codefound, commasec+1,1)
wpcval2 = val(wpcval2)
wpcval3 = Substr(codefound, AtNext(",", codefound,2)+1,1)
wpcval3 = val(wpcval3)
wpcval4 = Substr(codefound, AtNext(",", codefound,3)+1, AtNext(",",codefound,4)-AtNext(",",codefound,3)-1)
wpcval4 = Val(wpcval4)
wpcval5 = Substr(codefound, AtNext(",", codefound,4)+1, AtNext(",",codefound,5)-AtNext(",",codefound,4)-1)
wpcval5 = val(wpcval5)
wpcval6 = Substr(codefound, AtNext(",", codefound,5)+1)
wpcval6 = val(wpcval6)
WpFig(wpcval1, wpcval2, wpcval3, wpcval4, wpcval5, wpcval6)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Newspaper Columns (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "NEWCOL|ON" $ codefound
WpClmOn()
CASE "NEWCOL|OFF" $ codefound
WpClmOff()
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Font change │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "FNTCHG|" $ codefound
mark = AT("|", codefound)
If mark > 0
mark=mark+1
wpcval = Max (VAL(Alltrim(SUBSTR(codefound, mark))), 1)
If wpcval > 0
wpfont(wpcval)
Endif
Endif
* ┌───────────────────────────────────────────────────────────────────────┐
* ▌│ Header A/B Footer A/B (On) (Off) │
* ▌└───────────────────────────────────────────────────────────────────────┘
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
CASE "H/FSTART|" $ codefound
mark = AT("|", codefound)
If mark > 0
commafir = 0
commasec = ATNEXT(",", codefound,1)
If commasec > 0
wpcval1 = VAL(Substr(codefound, mark + 1, commasec - mark - 1))
wpcval2 = VAL(Substr(codefound, commasec+1,1))
Wphfstrt(wpcval1, wpcval2)
Endif
Endif
CASE "H/FEND|" $ codefound
WpHfend()
ENDCASE
Return(.t.)